# 线程函数
import os
import threading
from time import sleep


def music():
    for i in range(3):
        sleep(2)
        print(os.getpid(),"播放：男儿当自强")

# 实例化线程对象
thread = threading.Thread(target=music)

# 启动线程 执行music
thread.start()

# 主线程来了
for i in range(4):
    sleep(1)
    print(os.getpid(),"播放：月亮之上")